package com.ycfmedical.bed.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.ycfmedical.bed.R;
import com.ycfmedical.bed.adapter.DiagnosisRecordsAdapter;
import com.ycfmedical.bed.bean.TextContent;
import com.ycfmedical.bed.present.DiagnosisRecordsPresent;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import cn.droidlover.xdroidmvp.mvp.XFragment;
import cn.droidlover.xrecyclerview.XRecyclerContentLayout;

/**
 * Created by yf on 2017-05-01.
 */

public class DiagnosisRecordsFragment extends XFragment<DiagnosisRecordsPresent> {
    @BindView(R.id.diacrisisImg)
    ImageView diacrisisImg;
    @BindView(R.id.diacrisisImgTitle)
    TextView diacrisisImgTitle;
    @BindView(R.id.bingLiNumber)
    TextView bingLiNumber;
    @BindView(R.id.diacrisisDiscribe)
    XRecyclerContentLayout diacrisisDiscribe;
    @BindView(R.id.neiJingDiacrisis)
    XRecyclerContentLayout neiJingDiacrisis;
    Unbinder unbinder;

    DiagnosisRecordsAdapter diacrisisDiscribeAdapter;
    DiagnosisRecordsAdapter neiJingDiacrisisAdapter;
    @Override
    public void initData(Bundle savedInstanceState) {
        diacrisisDiscribeAdapter=new DiagnosisRecordsAdapter(getContext());
        neiJingDiacrisisAdapter=new DiagnosisRecordsAdapter(getContext());

        neiJingDiacrisis.getRecyclerView().verticalLayoutManager(getContext());
        neiJingDiacrisis.getRecyclerView().setAdapter(neiJingDiacrisisAdapter);

        diacrisisDiscribe.getRecyclerView().verticalLayoutManager(getContext());
        diacrisisDiscribe.getRecyclerView().setAdapter(diacrisisDiscribeAdapter);
        getP().loadData();

    }
public void showneiJingDiacrisis(List<TextContent> textContentList){
    neiJingDiacrisisAdapter.setData(textContentList);
    neiJingDiacrisisAdapter.notifyDataSetChanged();
}
    public void showdiacrisisDiscribe(List<TextContent> textContentList){
        diacrisisDiscribeAdapter.setData(textContentList);
        diacrisisDiscribeAdapter.notifyDataSetChanged();
    }
    @Override
    public int getLayoutId() {
        return R.layout.fragment_his_diagnosis_records;
    }

    @Override
    public DiagnosisRecordsPresent newP() {
        return new DiagnosisRecordsPresent();
    }

}
